package com.nest.WorkNest.act;

import android.os.Bundle;
import android.view.View;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.ToggleButton;

import com.nest.WorkNest.R;
import com.umeng.update.UmengUpdateAgent;

/**
 * 设置界面
 *
 * @author llf
 */
public class SettingsAct extends BaseActivity {
    private ToggleButton toggle;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_settings);
        initBar();
        actionbar_side_tab_name.setVisibility(View.VISIBLE);
        actionbar_side_tab_name.setText("设置");
        ll_iv_actionbar_tab_side_left.setVisibility(View.VISIBLE);
        tabBack();
        initView();
        initClick();
    }

    private void initView() {
        // 初始化其他控件
        toggle = (ToggleButton) findViewById(R.id.toggle);
    }

    private void initClick() {
        toggle.setOnCheckedChangeListener(new OnCheckedChangeListener() {

            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                if (isChecked) {
                    showToast("确定");
                } else {
                    showToast("取消");
                }
            }
        });
    }

    public void check(View v) {
        UmengUpdateAgent.update(this);
    }
}
